<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/conn.asp"-->
<!--#include file="lib/saferequest.asp"-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<link rel="stylesheet" href="lib/sheet.css" type="text/css">
<script type="text/javascript" src="lib/jquery_lastest.js"></script>
<script type="text/javascript">
	$(function() {
		$(".contable").addClass("ct");	//载入table样式
		$(".contable th").addClass("ch").css("background-color","silver");	//载入th样式
		$(".contable td").addClass("ld");	//载入td样式
		$("#tj").click(function(){
			if($("#salesman_name").val()==""){
				alert("请输入业务员名称！");
				return false;
			}
		
		});
	
	});
</script>	
</head>
<%
call CheckRights(1,4)
%>


<body>
<%
if request.QueryString("salesman_id")<>"" then salesman_id=SafeRequest("salesman_id",1) Else response.end
set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM salesman where salesman_id="&salesman_id
rs.open sql,conn,1,1
If rs.eof Then
	response.write("未找到记录！")
	response.end
End if
if request.form("tj")="编辑" then
	salesman_name=SafeRequest("salesman_name",0)
	salesman_phone=SafeRequest("salesman_phone",0)
	sql="update salesman set salesman_name='"&salesman_name&"',salesman_phone='"&salesman_phone&"' where salesman_id="&salesman_id 
	'response.write sql
	'response.end
	set cmd=Server.CreateObject("ADODB.Command")
	cmd.ActiveConnection=conn
	cmd.CommandText = sql
	cmd.Execute
	view_url="salesman.asp"
	response.Redirect(view_url)
end if

%>
<p><a href="salesman.asp">业务员信息管理</a>&gt;&gt;<a href="edit_salesman.asp?salesman_id=<%=salesman_id%>">编辑业务员</a>&gt;&gt;</p>
<form name="form1" method="post" action="#">
<table class="contable">
	<tr>
		<th>业务员名称</th>
		<td><input id="salesman_name" name="salesman_name" value="<%=rs("salesman_name")%>" maxlength="50" size="50" /></td>
	</tr>
	<tr>
		<th>联系电话</th>
		<td><input id="salesman_phone" name="salesman_phone" value="<%=rs("salesman_phone")%>" maxlength="50" size="50" /></td>
	</tr>
	<tr>
		<th colspan="2"><input class="bt" type="submit" name="tj" id="tj" value="编辑" /></th>
	</tr>
</table>
</form>
<%
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
</body>
</html>
